/**
 * 本方法为摸牌起手跑自己的下跑 - 跑自己的碰牌或者畏牌
 * 如果pai_type是碰牌，那么本次跑是所有人都看到，如果是畏牌的跑；那么还是只能自己看到一张
 * @param who_uid        谁跑的
 * @param card_number    跑的什么数字（非跑牌人该数字是0）
 * @param is_chong       是否重跑
 */
function draw_play_mopao_ziji_xiapao( who_uid , card_number , is_chong , pai_type ){
    var xiaopai_name = card_number <= 10 ? 'ss' + card_number : 's' + (card_number-10);
    var bg_url = pai_type == "peng" ? 'res/pai/xp/' + xiaopai_name + '.png' : 'res/cd_huxiBG.png';
    delete_all_bg();
    /*******************************************************************************************************************/
    //需要被小牌移动到覆盖的地方记录
    var fugai_x = 0;var fugai_y = 0;
    //如果摸牌起跑者是自己
    if( who_uid == PB_USER_UID && card_number != 0 ){
        //将牌面上的这个被摸出来的牌缩小然后移动到本方的墩上
        PL_Room_Play.removeChild( PL_Room_Play.MOPAI_BG );
        PL_Room_Play.removeChild( PL_Room_Play.MOPAI_BG2 );
        //找出自己之前畏或者碰的记录；
        for( var x = 0 ; x < WEI_PAI_ZJ.length ; x++ ){
            if( WEI_PAI_ZJ[x].card_number == card_number ){fugai_x = WEI_PAI_ZJ[x].x;fugai_y = WEI_PAI_ZJ[x].y;PL_Room_Play.removeChild( WEI_PAI_ZJ[x] );}
        }
        for( var x = 0 ; x < PENG_PAI_ZJ.length ; x++ ){
            if( PENG_PAI_ZJ[x].card_number == card_number ){fugai_x = PENG_PAI_ZJ[x].x;fugai_y = PENG_PAI_ZJ[x].y;PL_Room_Play.removeChild( PENG_PAI_ZJ[x] );}
        }
        //移动3张背景牌 + 1张号码牌
        for( var i = 0 ; i <= 3 ; i++ ){
            //小牌移动
            if( i <= 2 ){
                var temp     = cc.Sprite.create( bg_url );
            }else{
                var temp     = cc.Sprite.create('res/pai/xp/' + xiaopai_name + '.png');
            }
            temp.x       = PL_Room_Play.realy_size.width / 2;
            temp.y       = PL_Room_Play.realy_size.height / 2;
            PL_Room_Play.addChild( temp );
            temp.runAction( cc.MoveTo.create( 0.2 , cc.p(  fugai_x , 42*(i) - 500 + LB_XP_HEIGHT ) ) );
            MISCE.push( temp );//添加杂项
        }
        //理牌
        draw_play_paireset();
    }
    //移动被摸出来的这个小牌
    PL_Room_Play.removeChild( PL_Room_Play.MOPAI_BG );
    //如果是下家摸牌起跑
    if( who_uid == ROOM_WS_XJ ){
        cc.log( PENG_PAI_XJ );
        //遍历已经碰过的或者畏过的牌;找到他们的位置；替换掉他们
        for( var i = 0 ; i < PENG_PAI_XJ.length ; i++ ){
            if( PENG_PAI_XJ[i].card_number == card_number ){
                fugai_x = PENG_PAI_XJ[i].x;fugai_y = PENG_PAI_XJ[i].y;
                PL_Room_Play.removeChild( PENG_PAI_XJ[i] );
            }
        }
        for( var i = 0 ; i < WEI_PAI_XJ.length ; i++ ){
            if( WEI_PAI_XJ[i].card_number == card_number ){
                fugai_x = WEI_PAI_XJ[i].x;fugai_y = WEI_PAI_XJ[i].y;
                PL_Room_Play.removeChild( WEI_PAI_XJ[i] );
            }
        }
        //移动3张背景牌 + 1张号码牌
        for( var i = 0 ; i <= 3 ; i++ ){
            var temp     = cc.Sprite.create( bg_url );
            temp.x       = PL_Room_Play.realy_size.width - 250;temp.y       = PL_Room_Play.realy_size.height / 2;
            PL_Room_Play.addChild( temp );
            temp.runAction( cc.MoveTo.create( 0.2 , cc.p(  fugai_x , 42 * i + RB_XP_HEIGHT ) ) );
            MISCE.push( temp );//添加杂项
        }
    }
    //如果是上家摸牌起跑
    if( who_uid == ROOM_WS_SJ ){
        //遍历已经碰过的或者畏过的牌;找到他们的位置；替换掉他们
        for( var i = 0 ; i < PENG_PAI_SJ.length ; i++ ){
            if( PENG_PAI_SJ[i].card_number == card_number ){
                fugai_x = PENG_PAI_SJ[i].x;fugai_y = PENG_PAI_SJ[i].y;
                PL_Room_Play.removeChild( PENG_PAI_SJ[i] );
            }
        }
        for( var i = 0 ; i < WEI_PAI_SJ.length ; i++ ){
            if( WEI_PAI_SJ[i].card_number == card_number ){
                fugai_x = WEI_PAI_SJ[i].x;fugai_y = WEI_PAI_SJ[i].y;
                PL_Room_Play.removeChild( WEI_PAI_SJ[i] );
            }
        }
        //移动3张背景牌
        for( var i = 0 ; i <= 3 ; i++ ){
            var temp     = cc.Sprite.create( bg_url );
            temp.x       = 250;temp.y       = PL_Room_Play.realy_size.height - 250;
            PL_Room_Play.addChild( temp );
            temp.runAction( cc.MoveTo.create( 0.2 , cc.p(  fugai_x , PL_Room_Play.realy_size.height - TOP_LEFT_XP_HEIGHT -  45 * i ) ) );
            MISCE.push( temp );//添加杂项
        }
    }
    //如果是对家摸牌起跑
    if( who_uid == ROOM_WS_DM ){
        //遍历已经碰过的或者畏过的牌;找到他们的位置；替换掉他们
        for( var i = 0 ; i < PENG_PAI_DM.length ; i++ ){
            if( PENG_PAI_DM[i].card_number == card_number ){
                fugai_x = PENG_PAI_DM[i].x;fugai_y = PENG_PAI_DM[i].y;
                PL_Room_Play.removeChild( PENG_PAI_DM[i] );
            }
        }
        for( var i = 0 ; i < WEI_PAI_DM.length ; i++ ){
            if( WEI_PAI_DM[i].card_number == card_number ){
                fugai_x = WEI_PAI_DM[i].x;fugai_y = WEI_PAI_DM[i].y;
                PL_Room_Play.removeChild( WEI_PAI_DM[i] );
            }
        }
        //移动3张背景牌
        for( var i = 0 ; i <= 3 ; i++ ){
            var temp     = cc.Sprite.create( bg_url );
            temp.x       = PL_Room_Play.realy_size.width - 250;temp.y       = PL_Room_Play.realy_size.height - 250;
            PL_Room_Play.addChild( temp );
            temp.runAction( cc.MoveTo.create( 0.2 , cc.p(  fugai_x , PL_Room_Play.realy_size.height - TOP_LEFT_XP_HEIGHT -  45*i ) ) );
            MISCE.push( temp );//添加杂项
        }
    }
    //进行trip操作
    show_tripAND_sound( 'pao' , who_uid , is_chong );
}